﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

namespace MLM.AdminCP.Pages
{
    public partial class Shippingfee : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                ShippenFreeEds.WhereParameters.Add("UserId", System.Data.DbType.Int64, Permission.GetCurrentUserId().ToString());
            RadCitiesGrid.ItemDataBound += new Telerik.Web.UI.GridItemEventHandler(RadCitiesGrid_ItemDataBound);
        }

        void RadCitiesGrid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
            {
                var item = e.Item as GridEditFormItem;

                var nameTextBox = item.FindControl("RadTextBox3") as RadTextBox;

                // Insert mode
                if (e.Item.OwnerTableView.IsItemInserted)
                {
                    nameTextBox.Text = Permission.GetCurrentUserId().ToString();
                }
                else // Edit mode
                {

                }
            }


        }

    }
}